package com.swiftride.feign;

import com.swiftride.constants.Constants;
import com.swiftride.fallback.OrderFeignFallbackFactory;
import com.swiftride.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.validation.constraints.NotBlank;

@FeignClient(value = Constants.Remote.SERVICE_ORDER, path = "/app/order", contextId = "OrderFeign", fallbackFactory = OrderFeignFallbackFactory.class)
public interface OrderFeign {

    @GetMapping("/customer/cancelOrder/{orderNo}")
    R<Void> customerCancelOrder(@PathVariable(value = "orderNo") @NotBlank String orderNo);

    @GetMapping("/driver/cancelOrder/{orderNo}")
    R<Void> driverCancelOrder(@PathVariable(value = "orderNo") @NotBlank String orderNo);
}